package com.ruoyi.therapy.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.therapy.mapper.TherapyCategoryMapper;
import com.ruoyi.therapy.domain.TherapyCategory;
import com.ruoyi.therapy.service.ITherapyCategoryService;

/**
 * 项目分类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-09
 */
@Service
public class TherapyCategoryServiceImpl implements ITherapyCategoryService 
{
    @Autowired
    private TherapyCategoryMapper therapyCategoryMapper;

    /**
     * 查询项目分类
     * 
     * @param id 项目分类主键
     * @return 项目分类
     */
    @Override
    public TherapyCategory selectTherapyCategoryById(Long id)
    {
        return therapyCategoryMapper.selectTherapyCategoryById(id);
    }

    /**
     * 查询项目分类列表
     * 
     * @param therapyCategory 项目分类
     * @return 项目分类
     */
    @Override
    public List<TherapyCategory> selectTherapyCategoryList(TherapyCategory therapyCategory)
    {
        return therapyCategoryMapper.selectTherapyCategoryList(therapyCategory);
    }

    /**
     * 新增项目分类
     * 
     * @param therapyCategory 项目分类
     * @return 结果
     */
    @Override
    public int insertTherapyCategory(TherapyCategory therapyCategory)
    {
        therapyCategory.setCreateTime(DateUtils.getNowDate());
        return therapyCategoryMapper.insertTherapyCategory(therapyCategory);
    }

    /**
     * 修改项目分类
     * 
     * @param therapyCategory 项目分类
     * @return 结果
     */
    @Override
    public int updateTherapyCategory(TherapyCategory therapyCategory)
    {
        therapyCategory.setUpdateTime(DateUtils.getNowDate());
        return therapyCategoryMapper.updateTherapyCategory(therapyCategory);
    }

    /**
     * 批量删除项目分类
     * 
     * @param ids 需要删除的项目分类主键
     * @return 结果
     */
    @Override
    public int deleteTherapyCategoryByIds(Long[] ids)
    {
        return therapyCategoryMapper.deleteTherapyCategoryByIds(ids);
    }

    /**
     * 删除项目分类信息
     * 
     * @param id 项目分类主键
     * @return 结果
     */
    @Override
    public int deleteTherapyCategoryById(Long id)
    {
        return therapyCategoryMapper.deleteTherapyCategoryById(id);
    }
}
